# 计算某年某月某日是当年的第几天
# 知识点：强制转换，input_kw()和python2的区别   程序算法思路：只有闰年特殊，所以单独计算
year = int(input('year:\n'))
month = int(input('month:\n'))
day = int(input('day\n'))

months = (0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334)
sum_day = 0
if 0 < month <= 12:
    sum_day = months[month - 1]
else:
    print("data error !")
sum_day += day
leap = 0
if (year % 400 == 0) or (year % 4 == 0 and year % 100 != 0):
    leap = 1
if leap == 1 and month > 2:
    sum_day += 1
# print('it is the {}th day'.format(sum_day))
print('it is the %dth day' % sum_day)